﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
namespace HuynhQuangWebsite.Models
{
    [MetadataType(typeof(User_Validation))]
    public partial class User
    {
        [Required]
        [DataType(DataType.Password)]
        [DisplayName("Confirm password")]
        public string ConfirmPassword { get; set; }
        //
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Current password")]
        public string OldPassword { get; set; }

        public class User_Validation
        {
            [Required]
            [DisplayName("User name")]
            public string UserName { get; set; }

            [Required]
            [DataType(DataType.Password)]
            public String Password { get; set; }
            //
            [RegularExpression(@"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|" +
                    @"0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z]" +
                    @"[a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$", ErrorMessage = "Email không đúng định dạng (ví dụ: info@huynhquang.com).")]
            public string Email { get; set; }

        }
       
    }
}
